<template>
  <div>
    <div class="total_data">{{user_total}}</div>
  </div>
</template>

<script>
import {getTotalData} from "../api";

export default {
  name: 'TopCenter',
  data () {
    return {
      user_total: ''
    }
  },
  methods: {
    init () {
      setInterval(() => {
        getTotalData().then(res => {
          const data = res.data.data
          this.user_total = data.user_total
        })
      }, 3000)
    }
  },
  mounted () {
    this.init()
  }
}
</script>

<style lang="scss" scoped>
@import "src/assets/scss/var_";

.total_data {
  color: #ffffff;
  text-align: center;
  font-size: $fontSize_30;
  font-weight: bold;
  letter-spacing: 8px;
  line-height: $top_height;
  position: relative;

  &:after {
    content: '';
    position: absolute;
    width: $width_290;
    height: $height_17;
    bottom: 0;
    left: 50%;
    background: #3894ce;
    transform: translateX(-50%);
    box-shadow: 0 -5px 10px #3894ce;
    /*background-image: linear-gradient(45deg, red, blue);*/
  }
}
</style>
